package cn.qyd.javareflect;

/**
 * @author 邱运铎
 * @date 2024-03-03 23:32
 */
public class ReflectBaseApiDemo {
    public static void main(String[] args) throws Exception{
        //Class.forName(), 参数为反射类的完全限定名
        Class c1 = Class.forName("cn.qyd.javareflect.Write");
        System.out.println(c1.getCanonicalName());

        Class c2 = Class.forName("[D");
        System.out.println(c2.getCanonicalName());

        Class c3 = Class.forName("[[Ljava.lang.String;");
        System.out.println(c3.getCanonicalName());


        //类名+.Class,只适合在编译前就知道操作的Class
        Class c4 = Write.class;
        System.out.println(c4.getCanonicalName());

        Class c5 = String.class;
        System.out.println(c5.getCanonicalName());

        Class c6 = int[][][].class;
        System.out.println(c6.getCanonicalName());
    }
}
